<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
</head>
<script src="/js/jquery/2.0.0/jquery.min.js"></script>
<link href="/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="/js/bootstrap/3.3.6/bootstrap.min.js"></script>
<body>
<table class="table table-striped">
    <thead>
    <th>用户账号</th>
    <th>姓名</th>
    <th>年龄</th>
    <th>性别</th>
    <th>邮箱</th>
    <th>手机号</th>
    <th>角色</th>
    <th>权限</th>
    <th>修改</th>
    <th>删除</th>
    </thead>
    <tbody>
    <tr th:each="user: ${users}">
        <td th:text="${user.account}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.age}"></td>
        <td th:text="${user.gender}"></td>
        <td th:text="${user.mail}"></td>
        <td th:text="${user.phone}"></td>
        <td th:text="${user.role}"></td>
        <td th:text="${user.premission}"></td>
        <form action="/HTML/adminUpdateUserInfo" method="post" >
            <td class="col-md-1">
                <input type="text" name="account" th:value="${user.account}" >
                <button  class="btn btn-sm btn-primary " type="submit">修改</button>
            </td>
        </form>
        <form action="/HTML/deleteUser" method="post" >
            <td class="col-md-1">
                <input type="text" name="account" th:value="${user.account}" >
                <!--验证确定删除的功能-->
                <button  class="btn btn-sm btn-primary " type="submit" onclick="confirmDelete" >删除</button>
            </td>
        </form>
    </tr>
    </tbody>
</table>
<h4 class="text-info"  align="center" style="font-family:宋体;font-weight:bold;" >订单状态为0表示订单未生效，支付状态为0表示未支付</h4>
<script>
    function confirmDelete() {
        var r = confirm("此操作将删除此用户且不可复原，确定删除吗？")
        if (r == true) {
            x = "您按了确认！";
        } else {
            x = "您按了取消！";
        }
    }
</script>
</body>
</html>